package com.fit.networkShop.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.fit.networkShop.interfaces.Product;

public class ProductsBean implements Products{
	private Map<String, Product> products = new HashMap<String, Product>();
	
	public Collection<Product> retrieve() {
		return this.products.values();
	}

	public Product save(Product product) {
		return this.products.put(product.getName(), product);
	}
	
	public Product retrieveSingleProduct(String name) {
		return this.products.get(name);
	}
}
